﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OnlineTestBLL;
using OnlineTestModel;
using FineUI;

namespace OnlineTestUI
{
    public partial class register : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void BtAdd_Click(object sender, EventArgs e)
        {
            Students s = new Students();
            StudentsBLL sb = new StudentsBLL();
            s.UserName = tbUserName.Text;
            s.PassWord = tbPassWord.Text;
            s.RealName = tbRealName.Text;
            s.ClassId = 0;
            s.RoleId = 0;
            s.RoleList = "";
            s.Status = 0;
            s.CreateId = 0;
            s.CreateTime = DateTime.Now;
            s.LastLoginTime = DateTime.Now;
            int result = sb.Add(s);
            if (result > 0)
            {
                Session["student"] = s;
                PageContext.Redirect("default.aspx");
            }

        }
    }
}